﻿using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using DB;
public class ExzamSearch : IExzamSearch
{
    DataAccess da = new DataAccess();
    public void singleSearch()
    {
        throw new NotImplementedException();
    }

    public void courseSearch()
    {
        throw new NotImplementedException();
    }

    public void termSearch()
    {
        throw new NotImplementedException();
    }
    public string getExzamByCourseTech(string courseid, string techid)
    {

        string sql_str = "exec exzam_getExzamByCourseTech " + courseid;

        return JsonConvertor.getJsonTable(sql_str);
    }
    public string getExzamByStdTerm(string stdid, string yterm)
    {
        string[] termChange = TermUtils.splitYTerm(yterm);
        string year = termChange[0];
        string term = termChange[1];
        string sql_str = "exec exzam_getExzamByStdTerm " + stdid + "," + year + "," + term;
        return JsonConvertor.getJsonTable(sql_str);
    }

    public string getExzamByTechTerm(string techid, string yterm)
    {
        string[] termChange = TermUtils.splitYTerm(yterm);
        string year = termChange[0];
        string term = termChange[1];
        string sql_str = "exec exzam_getExzamByTechTerm " + techid + "," + year + "," + term;
        return JsonConvertor.getJsonTable(sql_str);
    }

}
